<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const createGenerator = async function * (){
            yield 'success1'
            //yield await new Promise((r) => r('success1'))
            yield 'success2'
            yield 'success3'
        }
        const main = () => {
            const generator = createGenerator()
            for (const item of generator){
                console.log(item)
            }
        }
        main()
    </script>
</body>
</html>